package edu.visualizetion.info.sensorcollection;

import java.io.FileNotFoundException;

import org.hyperic.sigar.Sigar;
import org.hyperic.sigar.SigarException;

public class Main {

	public static void main(String[] args) throws SigarException {
		
		System.out.println((float)(100/1000.0));

		String libPath = args[0];
		ClassPathUtils classPathUtils = new ClassPathUtils();
		try {
			classPathUtils.addLibToClassPath(libPath);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return;
		}

		Sigar sigar = new Sigar();
		System.out.println(sigar.getMem());
		System.out.println(sigar.getMem().getFreePercent());
		System.out.println(sigar.getMem().getUsedPercent());
//		String[] netInterfaceList = sigar.getNetInterfaceList();
//		while (true) {
//			for (String name : netInterfaceList) {
//				// System.out.println(name);
//				NetInterfaceConfig netInterfaceConfig = sigar.getNetInterfaceConfig(name);
//				NetInterfaceStat netInterfaceStat = sigar.getNetInterfaceStat(name);
//				NetInterfaceConfig ifconfig = sigar.getNetInterfaceConfig(name);
//				 System.out.println(ifconfig);
//				if (ifconfig.getAddress().equals("192.168.130.107")) {
//					System.out.println(ifconfig.getAddress() + " " + ifconfig.getDescription() + " "
//							+ ifconfig.getFlags() + " " + ifconfig.getNetmask());
//					System.out.println(netInterfaceStat);
//				}
//			}
//			try {
//				Thread.sleep(1000);
//			} catch (InterruptedException e) {
//				// TODO Auto-generated catch block
//				e.printStackTrace();
//			}
//		}
	}
}
